#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <limits.h>

int main(int argc, char const* argv[])
{
    unsigned long int address;

    if (argc != 2)
    {
        printf("usage: %s 0xXXXXXXXX\n", argv[0]);
        exit(1);
    }

    if ((address = strtoul(argv[1], NULL, 0)) == ULONG_MAX)
    {
        printf("usage: %s 0xXXXXXXXX\n", argv[0]);
        exit(1);
    }

    address = ntohl(address);
    printf("%s\n", inet_ntoa(*(struct in_addr *)&address));

    return 0;
}
